#! /usr/bin/env python3
import redis
from flask import Flask
from flask_script import Manager
from flask_session import Session

from app.models import db
from app.views import blue

app = Flask(__name__)

app.secret_key = '21212'

app.config['SESSION_TYPE'] = 'redis'
app.config['SESSION_REDIS'] = redis.Redis(host='47.102.192.226', password='1qaz2wsx', port=6379)
Session(app)


app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root:123456@47.102.192.226:3306/flask1901'

app.register_blueprint(blueprint=blue, url_prefix='/app')
db.init_app(app)

if __name__ == '__main__':
    manage = Manager(app)
    manage.run()
